﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace MimallAPI.Migrations
{
    public partial class init : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "GoodsInfo",
                columns: table => new
                {
                    GoodId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodPrice = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    GoodArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodBanben = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodColor = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodImg = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    GoodCount = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_GoodsInfo", x => x.GoodId);
                });

            migrationBuilder.CreateTable(
                name: "Indent",
                columns: table => new
                {
                    IndentId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    IndentNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IndentGooder = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    IndentSum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ReceId = table.Column<int>(type: "int", nullable: false),
                    GoodId = table.Column<int>(type: "int", nullable: false),
                    CarId = table.Column<int>(type: "int", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Indent", x => x.IndentId);
                });

            migrationBuilder.CreateTable(
                name: "ReceInfo",
                columns: table => new
                {
                    ReceId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    ReceName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    RecePhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ReceArea = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ReceEmail = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    sheng = table.Column<int>(type: "int", nullable: false),
                    shi = table.Column<int>(type: "int", nullable: false),
                    xian = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ReceInfo", x => x.ReceId);
                });

            migrationBuilder.CreateTable(
                name: "ShopCar",
                columns: table => new
                {
                    CarId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    GoodId = table.Column<int>(type: "int", nullable: false),
                    UserId = table.Column<int>(type: "int", nullable: false),
                    ReceId = table.Column<int>(type: "int", nullable: false),
                    CarCount = table.Column<int>(type: "int", nullable: false),
                    GoDelete = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ShopCar", x => x.CarId);
                });

            migrationBuilder.CreateTable(
                name: "Site",
                columns: table => new
                {
                    Sid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Sname = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Fid = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Site", x => x.Sid);
                });

            migrationBuilder.CreateTable(
                name: "UserInfo",
                columns: table => new
                {
                    UserId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    UserName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    UserPwd = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_UserInfo", x => x.UserId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "GoodsInfo");

            migrationBuilder.DropTable(
                name: "Indent");

            migrationBuilder.DropTable(
                name: "ReceInfo");

            migrationBuilder.DropTable(
                name: "ShopCar");

            migrationBuilder.DropTable(
                name: "Site");

            migrationBuilder.DropTable(
                name: "UserInfo");
        }
    }
}
